↳ Prolog
↳ PrologToPiTRSProof
↳ PrologToPiTRSProof
shapes_in(Matrix, N) → U1(Matrix, N, varmat_in(Matrix, MatrixWithVars))
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U1(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U2(Matrix, N, unif_matrx_in(MatrixWithVars))
unif_matrx_in(.(X, [])) → unif_matrx_out(.(X, []))
unif_matrx_in(.(L1, .(L2, Ls))) → U7(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_pairs_in([]) → unif_pairs_out([])
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U7(L1, L2, Ls, unif_lines_out(L1, L2)) → U8(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U8(L1, L2, Ls, unif_matrx_out(.(L2, Ls))) → unif_matrx_out(.(L1, .(L2, Ls)))
U2(Matrix, N, unif_matrx_out(MatrixWithVars)) → shapes_out(Matrix, N)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PrologToPiTRSProof
shapes_in(Matrix, N) → U1(Matrix, N, varmat_in(Matrix, MatrixWithVars))
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U1(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U2(Matrix, N, unif_matrx_in(MatrixWithVars))
unif_matrx_in(.(X, [])) → unif_matrx_out(.(X, []))
unif_matrx_in(.(L1, .(L2, Ls))) → U7(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_pairs_in([]) → unif_pairs_out([])
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U7(L1, L2, Ls, unif_lines_out(L1, L2)) → U8(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U8(L1, L2, Ls, unif_matrx_out(.(L2, Ls))) → unif_matrx_out(.(L1, .(L2, Ls)))
U2(Matrix, N, unif_matrx_out(MatrixWithVars)) → shapes_out(Matrix, N)
SHAPES_IN(Matrix, N) → U11(Matrix, N, varmat_in(Matrix, MatrixWithVars))
SHAPES_IN(Matrix, N) → VARMAT_IN(Matrix, MatrixWithVars)
VARMAT_IN(.(white, Xs), .(w(X), VXs)) → U61(Xs, X, VXs, varmat_in(Xs, VXs))
VARMAT_IN(.(white, Xs), .(w(X), VXs)) → VARMAT_IN(Xs, VXs)
VARMAT_IN(.(black, Xs), .(black, VXs)) → U51(Xs, VXs, varmat_in(Xs, VXs))
VARMAT_IN(.(black, Xs), .(black, VXs)) → VARMAT_IN(Xs, VXs)
VARMAT_IN(.(L, Ls), .(VL, VLs)) → U31(L, Ls, VL, VLs, varmat_in(L, VL))
VARMAT_IN(.(L, Ls), .(VL, VLs)) → VARMAT_IN(L, VL)
U31(L, Ls, VL, VLs, varmat_out(L, VL)) → U41(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U31(L, Ls, VL, VLs, varmat_out(L, VL)) → VARMAT_IN(Ls, VLs)
U11(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U21(Matrix, N, unif_matrx_in(MatrixWithVars))
U11(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → UNIF_MATRX_IN(MatrixWithVars)
UNIF_MATRX_IN(.(L1, .(L2, Ls))) → U71(L1, L2, Ls, unif_lines_in(L1, L2))
UNIF_MATRX_IN(.(L1, .(L2, Ls))) → UNIF_LINES_IN(L1, L2)
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U91(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → UNIF_PAIRS_IN(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))
UNIF_PAIRS_IN(.(A, .(B, Pairs))) → U111(A, B, Pairs, unif_in(A, B))
UNIF_PAIRS_IN(.(A, .(B, Pairs))) → UNIF_IN(A, B)
U111(A, B, Pairs, unif_out(A, B)) → U121(A, B, Pairs, unif_pairs_in(Pairs))
U111(A, B, Pairs, unif_out(A, B)) → UNIF_PAIRS_IN(Pairs)
U91(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U101(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U91(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → UNIF_LINES_IN(.(X, L1s), .(Z, L2s))
U71(L1, L2, Ls, unif_lines_out(L1, L2)) → U81(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U71(L1, L2, Ls, unif_lines_out(L1, L2)) → UNIF_MATRX_IN(.(L2, Ls))
shapes_in(Matrix, N) → U1(Matrix, N, varmat_in(Matrix, MatrixWithVars))
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U1(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U2(Matrix, N, unif_matrx_in(MatrixWithVars))
unif_matrx_in(.(X, [])) → unif_matrx_out(.(X, []))
unif_matrx_in(.(L1, .(L2, Ls))) → U7(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_pairs_in([]) → unif_pairs_out([])
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U7(L1, L2, Ls, unif_lines_out(L1, L2)) → U8(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U8(L1, L2, Ls, unif_matrx_out(.(L2, Ls))) → unif_matrx_out(.(L1, .(L2, Ls)))
U2(Matrix, N, unif_matrx_out(MatrixWithVars)) → shapes_out(Matrix, N)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ PrologToPiTRSProof
SHAPES_IN(Matrix, N) → U11(Matrix, N, varmat_in(Matrix, MatrixWithVars))
SHAPES_IN(Matrix, N) → VARMAT_IN(Matrix, MatrixWithVars)
VARMAT_IN(.(white, Xs), .(w(X), VXs)) → U61(Xs, X, VXs, varmat_in(Xs, VXs))
VARMAT_IN(.(white, Xs), .(w(X), VXs)) → VARMAT_IN(Xs, VXs)
VARMAT_IN(.(black, Xs), .(black, VXs)) → U51(Xs, VXs, varmat_in(Xs, VXs))
VARMAT_IN(.(black, Xs), .(black, VXs)) → VARMAT_IN(Xs, VXs)
VARMAT_IN(.(L, Ls), .(VL, VLs)) → U31(L, Ls, VL, VLs, varmat_in(L, VL))
VARMAT_IN(.(L, Ls), .(VL, VLs)) → VARMAT_IN(L, VL)
U31(L, Ls, VL, VLs, varmat_out(L, VL)) → U41(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U31(L, Ls, VL, VLs, varmat_out(L, VL)) → VARMAT_IN(Ls, VLs)
U11(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U21(Matrix, N, unif_matrx_in(MatrixWithVars))
U11(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → UNIF_MATRX_IN(MatrixWithVars)
UNIF_MATRX_IN(.(L1, .(L2, Ls))) → U71(L1, L2, Ls, unif_lines_in(L1, L2))
UNIF_MATRX_IN(.(L1, .(L2, Ls))) → UNIF_LINES_IN(L1, L2)
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U91(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → UNIF_PAIRS_IN(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))
UNIF_PAIRS_IN(.(A, .(B, Pairs))) → U111(A, B, Pairs, unif_in(A, B))
UNIF_PAIRS_IN(.(A, .(B, Pairs))) → UNIF_IN(A, B)
U111(A, B, Pairs, unif_out(A, B)) → U121(A, B, Pairs, unif_pairs_in(Pairs))
U111(A, B, Pairs, unif_out(A, B)) → UNIF_PAIRS_IN(Pairs)
U91(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U101(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U91(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → UNIF_LINES_IN(.(X, L1s), .(Z, L2s))
U71(L1, L2, Ls, unif_lines_out(L1, L2)) → U81(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U71(L1, L2, Ls, unif_lines_out(L1, L2)) → UNIF_MATRX_IN(.(L2, Ls))
shapes_in(Matrix, N) → U1(Matrix, N, varmat_in(Matrix, MatrixWithVars))
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U1(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U2(Matrix, N, unif_matrx_in(MatrixWithVars))
unif_matrx_in(.(X, [])) → unif_matrx_out(.(X, []))
unif_matrx_in(.(L1, .(L2, Ls))) → U7(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_pairs_in([]) → unif_pairs_out([])
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U7(L1, L2, Ls, unif_lines_out(L1, L2)) → U8(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U8(L1, L2, Ls, unif_matrx_out(.(L2, Ls))) → unif_matrx_out(.(L1, .(L2, Ls)))
U2(Matrix, N, unif_matrx_out(MatrixWithVars)) → shapes_out(Matrix, N)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDP
↳ PiDP
↳ PrologToPiTRSProof
UNIF_PAIRS_IN(.(A, .(B, Pairs))) → U111(A, B, Pairs, unif_in(A, B))
U111(A, B, Pairs, unif_out(A, B)) → UNIF_PAIRS_IN(Pairs)
shapes_in(Matrix, N) → U1(Matrix, N, varmat_in(Matrix, MatrixWithVars))
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U1(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U2(Matrix, N, unif_matrx_in(MatrixWithVars))
unif_matrx_in(.(X, [])) → unif_matrx_out(.(X, []))
unif_matrx_in(.(L1, .(L2, Ls))) → U7(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_pairs_in([]) → unif_pairs_out([])
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U7(L1, L2, Ls, unif_lines_out(L1, L2)) → U8(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U8(L1, L2, Ls, unif_matrx_out(.(L2, Ls))) → unif_matrx_out(.(L1, .(L2, Ls)))
U2(Matrix, N, unif_matrx_out(MatrixWithVars)) → shapes_out(Matrix, N)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ PiDP
↳ PiDP
↳ PiDP
↳ PrologToPiTRSProof
UNIF_PAIRS_IN(.(A, .(B, Pairs))) → U111(A, B, Pairs, unif_in(A, B))
U111(A, B, Pairs, unif_out(A, B)) → UNIF_PAIRS_IN(Pairs)
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ QDPSizeChangeProof
↳ PiDP
↳ PiDP
↳ PiDP
↳ PrologToPiTRSProof
U111(Pairs, unif_out) → UNIF_PAIRS_IN(Pairs)
UNIF_PAIRS_IN(.(A, .(B, Pairs))) → U111(Pairs, unif_in(A, B))
unif_in(w, black) → unif_out
unif_in(black, w) → unif_out
unif_in(black, black) → unif_out
unif_in(w, w) → unif_out
unif_in(x0, x1)
From the DPs we obtained the following set of size-change graphs:
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDP
↳ PrologToPiTRSProof
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U91(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
U91(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → UNIF_LINES_IN(.(X, L1s), .(Z, L2s))
shapes_in(Matrix, N) → U1(Matrix, N, varmat_in(Matrix, MatrixWithVars))
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U1(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U2(Matrix, N, unif_matrx_in(MatrixWithVars))
unif_matrx_in(.(X, [])) → unif_matrx_out(.(X, []))
unif_matrx_in(.(L1, .(L2, Ls))) → U7(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_pairs_in([]) → unif_pairs_out([])
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U7(L1, L2, Ls, unif_lines_out(L1, L2)) → U8(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U8(L1, L2, Ls, unif_matrx_out(.(L2, Ls))) → unif_matrx_out(.(L1, .(L2, Ls)))
U2(Matrix, N, unif_matrx_out(MatrixWithVars)) → shapes_out(Matrix, N)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ PiDP
↳ PiDP
↳ PrologToPiTRSProof
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U91(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
U91(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → UNIF_LINES_IN(.(X, L1s), .(Z, L2s))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
unif_pairs_in([]) → unif_pairs_out([])
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ Rewriting
↳ PiDP
↳ PiDP
↳ PrologToPiTRSProof
U91(X, L1s, Z, L2s, unif_pairs_out) → UNIF_LINES_IN(.(X, L1s), .(Z, L2s))
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U91(X, L1s, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(Pairs, unif_in(A, B))
U11(Pairs, unif_out) → U12(unif_pairs_in(Pairs))
unif_in(w, black) → unif_out
unif_in(black, w) → unif_out
unif_in(black, black) → unif_out
unif_in(w, w) → unif_out
U12(unif_pairs_out) → unif_pairs_out
unif_pairs_in([]) → unif_pairs_out
unif_pairs_in(x0)
U11(x0, x1)
unif_in(x0, x1)
U12(x0)
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U91(X, L1s, Z, L2s, U11(.(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))), unif_in(W, X)))
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ Rewriting
↳ QDP
↳ QDPOrderProof
↳ PiDP
↳ PiDP
↳ PrologToPiTRSProof
U91(X, L1s, Z, L2s, unif_pairs_out) → UNIF_LINES_IN(.(X, L1s), .(Z, L2s))
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U91(X, L1s, Z, L2s, U11(.(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))), unif_in(W, X)))
unif_pairs_in(.(A, .(B, Pairs))) → U11(Pairs, unif_in(A, B))
U11(Pairs, unif_out) → U12(unif_pairs_in(Pairs))
unif_in(w, black) → unif_out
unif_in(black, w) → unif_out
unif_in(black, black) → unif_out
unif_in(w, w) → unif_out
U12(unif_pairs_out) → unif_pairs_out
unif_pairs_in([]) → unif_pairs_out
unif_pairs_in(x0)
U11(x0, x1)
unif_in(x0, x1)
U12(x0)
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U91(X, L1s, Z, L2s, U11(.(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))), unif_in(W, X)))
Used ordering: Polynomial interpretation [25]:
U91(X, L1s, Z, L2s, unif_pairs_out) → UNIF_LINES_IN(.(X, L1s), .(Z, L2s))
POL(.(x1, x2)) = 1 + x2
POL(U11(x1, x2)) = 0
POL(U12(x1)) = 0
POL(U91(x1, x2, x3, x4, x5)) = 1 + x4
POL(UNIF_LINES_IN(x1, x2)) = x2
POL([]) = 1
POL(black) = 1
POL(unif_in(x1, x2)) = 1 + x2
POL(unif_out) = 0
POL(unif_pairs_in(x1)) = 1 + x1
POL(unif_pairs_out) = 1
POL(w) = 0
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ Rewriting
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
↳ PiDP
↳ PiDP
↳ PrologToPiTRSProof
U91(X, L1s, Z, L2s, unif_pairs_out) → UNIF_LINES_IN(.(X, L1s), .(Z, L2s))
unif_pairs_in(.(A, .(B, Pairs))) → U11(Pairs, unif_in(A, B))
U11(Pairs, unif_out) → U12(unif_pairs_in(Pairs))
unif_in(w, black) → unif_out
unif_in(black, w) → unif_out
unif_in(black, black) → unif_out
unif_in(w, w) → unif_out
U12(unif_pairs_out) → unif_pairs_out
unif_pairs_in([]) → unif_pairs_out
unif_pairs_in(x0)
U11(x0, x1)
unif_in(x0, x1)
U12(x0)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PrologToPiTRSProof
U71(L1, L2, Ls, unif_lines_out(L1, L2)) → UNIF_MATRX_IN(.(L2, Ls))
UNIF_MATRX_IN(.(L1, .(L2, Ls))) → U71(L1, L2, Ls, unif_lines_in(L1, L2))
shapes_in(Matrix, N) → U1(Matrix, N, varmat_in(Matrix, MatrixWithVars))
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U1(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U2(Matrix, N, unif_matrx_in(MatrixWithVars))
unif_matrx_in(.(X, [])) → unif_matrx_out(.(X, []))
unif_matrx_in(.(L1, .(L2, Ls))) → U7(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_pairs_in([]) → unif_pairs_out([])
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U7(L1, L2, Ls, unif_lines_out(L1, L2)) → U8(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U8(L1, L2, Ls, unif_matrx_out(.(L2, Ls))) → unif_matrx_out(.(L1, .(L2, Ls)))
U2(Matrix, N, unif_matrx_out(MatrixWithVars)) → shapes_out(Matrix, N)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ PiDP
↳ PrologToPiTRSProof
U71(L1, L2, Ls, unif_lines_out(L1, L2)) → UNIF_MATRX_IN(.(L2, Ls))
UNIF_MATRX_IN(.(L1, .(L2, Ls))) → U71(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
unif_pairs_in([]) → unif_pairs_out([])
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ QDPOrderProof
↳ PiDP
↳ PrologToPiTRSProof
U71(L2, Ls, unif_lines_out) → UNIF_MATRX_IN(.(L2, Ls))
UNIF_MATRX_IN(.(L1, .(L2, Ls))) → U71(L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(X, L1s, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
U9(X, L1s, Z, L2s, unif_pairs_out) → U10(unif_lines_in(.(X, L1s), .(Z, L2s)))
unif_pairs_in(.(A, .(B, Pairs))) → U11(Pairs, unif_in(A, B))
U10(unif_lines_out) → unif_lines_out
U11(Pairs, unif_out) → U12(unif_pairs_in(Pairs))
unif_in(w, black) → unif_out
unif_in(black, w) → unif_out
unif_in(black, black) → unif_out
unif_in(w, w) → unif_out
U12(unif_pairs_out) → unif_pairs_out
unif_pairs_in([]) → unif_pairs_out
unif_lines_in(x0, x1)
U9(x0, x1, x2, x3, x4)
unif_pairs_in(x0)
U10(x0)
U11(x0, x1)
unif_in(x0, x1)
U12(x0)
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
UNIF_MATRX_IN(.(L1, .(L2, Ls))) → U71(L2, Ls, unif_lines_in(L1, L2))
Used ordering: Polynomial interpretation [25]:
U71(L2, Ls, unif_lines_out) → UNIF_MATRX_IN(.(L2, Ls))
POL(.(x1, x2)) = 1 + x1 + x2
POL(U10(x1)) = 0
POL(U11(x1, x2)) = 1 + x2
POL(U12(x1)) = 1
POL(U71(x1, x2, x3)) = 1 + x1 + x2
POL(U9(x1, x2, x3, x4, x5)) = 0
POL(UNIF_MATRX_IN(x1)) = x1
POL([]) = 1
POL(black) = 0
POL(unif_in(x1, x2)) = 0
POL(unif_lines_in(x1, x2)) = 0
POL(unif_lines_out) = 0
POL(unif_out) = 1
POL(unif_pairs_in(x1)) = x1
POL(unif_pairs_out) = 0
POL(w) = 0
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ DependencyGraphProof
↳ PiDP
↳ PrologToPiTRSProof
U71(L2, Ls, unif_lines_out) → UNIF_MATRX_IN(.(L2, Ls))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(X, L1s, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
U9(X, L1s, Z, L2s, unif_pairs_out) → U10(unif_lines_in(.(X, L1s), .(Z, L2s)))
unif_pairs_in(.(A, .(B, Pairs))) → U11(Pairs, unif_in(A, B))
U10(unif_lines_out) → unif_lines_out
U11(Pairs, unif_out) → U12(unif_pairs_in(Pairs))
unif_in(w, black) → unif_out
unif_in(black, w) → unif_out
unif_in(black, black) → unif_out
unif_in(w, w) → unif_out
U12(unif_pairs_out) → unif_pairs_out
unif_pairs_in([]) → unif_pairs_out
unif_lines_in(x0, x1)
U9(x0, x1, x2, x3, x4)
unif_pairs_in(x0)
U10(x0)
U11(x0, x1)
unif_in(x0, x1)
U12(x0)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PrologToPiTRSProof
U31(L, Ls, VL, VLs, varmat_out(L, VL)) → VARMAT_IN(Ls, VLs)
VARMAT_IN(.(white, Xs), .(w(X), VXs)) → VARMAT_IN(Xs, VXs)
VARMAT_IN(.(L, Ls), .(VL, VLs)) → VARMAT_IN(L, VL)
VARMAT_IN(.(L, Ls), .(VL, VLs)) → U31(L, Ls, VL, VLs, varmat_in(L, VL))
VARMAT_IN(.(black, Xs), .(black, VXs)) → VARMAT_IN(Xs, VXs)
shapes_in(Matrix, N) → U1(Matrix, N, varmat_in(Matrix, MatrixWithVars))
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U1(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U2(Matrix, N, unif_matrx_in(MatrixWithVars))
unif_matrx_in(.(X, [])) → unif_matrx_out(.(X, []))
unif_matrx_in(.(L1, .(L2, Ls))) → U7(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_pairs_in([]) → unif_pairs_out([])
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U7(L1, L2, Ls, unif_lines_out(L1, L2)) → U8(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U8(L1, L2, Ls, unif_matrx_out(.(L2, Ls))) → unif_matrx_out(.(L1, .(L2, Ls)))
U2(Matrix, N, unif_matrx_out(MatrixWithVars)) → shapes_out(Matrix, N)
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ PrologToPiTRSProof
U31(L, Ls, VL, VLs, varmat_out(L, VL)) → VARMAT_IN(Ls, VLs)
VARMAT_IN(.(white, Xs), .(w(X), VXs)) → VARMAT_IN(Xs, VXs)
VARMAT_IN(.(L, Ls), .(VL, VLs)) → VARMAT_IN(L, VL)
VARMAT_IN(.(L, Ls), .(VL, VLs)) → U31(L, Ls, VL, VLs, varmat_in(L, VL))
VARMAT_IN(.(black, Xs), .(black, VXs)) → VARMAT_IN(Xs, VXs)
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
↳ Prolog
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
↳ DependencyGraphProof
↳ AND
↳ PiDP
↳ PiDP
↳ PiDP
↳ PiDP
↳ UsableRulesProof
↳ PiDP
↳ PiDPToQDPProof
↳ QDP
↳ QDPSizeChangeProof
↳ PrologToPiTRSProof
VARMAT_IN(.(white, Xs)) → VARMAT_IN(Xs)
VARMAT_IN(.(black, Xs)) → VARMAT_IN(Xs)
VARMAT_IN(.(L, Ls)) → U31(Ls, varmat_in(L))
VARMAT_IN(.(L, Ls)) → VARMAT_IN(L)
U31(Ls, varmat_out(VL)) → VARMAT_IN(Ls)
varmat_in(.(white, Xs)) → U6(varmat_in(Xs))
varmat_in(.(black, Xs)) → U5(varmat_in(Xs))
varmat_in(.(L, Ls)) → U3(Ls, varmat_in(L))
varmat_in([]) → varmat_out([])
U6(varmat_out(VXs)) → varmat_out(.(w, VXs))
U5(varmat_out(VXs)) → varmat_out(.(black, VXs))
U3(Ls, varmat_out(VL)) → U4(VL, varmat_in(Ls))
U4(VL, varmat_out(VLs)) → varmat_out(.(VL, VLs))
varmat_in(x0)
U6(x0)
U5(x0)
U3(x0, x1)
U4(x0, x1)
From the DPs we obtained the following set of size-change graphs:
shapes_in(Matrix, N) → U1(Matrix, N, varmat_in(Matrix, MatrixWithVars))
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U1(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U2(Matrix, N, unif_matrx_in(MatrixWithVars))
unif_matrx_in(.(X, [])) → unif_matrx_out(.(X, []))
unif_matrx_in(.(L1, .(L2, Ls))) → U7(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_pairs_in([]) → unif_pairs_out([])
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U7(L1, L2, Ls, unif_lines_out(L1, L2)) → U8(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U8(L1, L2, Ls, unif_matrx_out(.(L2, Ls))) → unif_matrx_out(.(L1, .(L2, Ls)))
U2(Matrix, N, unif_matrx_out(MatrixWithVars)) → shapes_out(Matrix, N)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
↳ Prolog
↳ PrologToPiTRSProof
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
shapes_in(Matrix, N) → U1(Matrix, N, varmat_in(Matrix, MatrixWithVars))
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U1(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U2(Matrix, N, unif_matrx_in(MatrixWithVars))
unif_matrx_in(.(X, [])) → unif_matrx_out(.(X, []))
unif_matrx_in(.(L1, .(L2, Ls))) → U7(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_pairs_in([]) → unif_pairs_out([])
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U7(L1, L2, Ls, unif_lines_out(L1, L2)) → U8(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U8(L1, L2, Ls, unif_matrx_out(.(L2, Ls))) → unif_matrx_out(.(L1, .(L2, Ls)))
U2(Matrix, N, unif_matrx_out(MatrixWithVars)) → shapes_out(Matrix, N)
SHAPES_IN(Matrix, N) → U11(Matrix, N, varmat_in(Matrix, MatrixWithVars))
SHAPES_IN(Matrix, N) → VARMAT_IN(Matrix, MatrixWithVars)
VARMAT_IN(.(white, Xs), .(w(X), VXs)) → U61(Xs, X, VXs, varmat_in(Xs, VXs))
VARMAT_IN(.(white, Xs), .(w(X), VXs)) → VARMAT_IN(Xs, VXs)
VARMAT_IN(.(black, Xs), .(black, VXs)) → U51(Xs, VXs, varmat_in(Xs, VXs))
VARMAT_IN(.(black, Xs), .(black, VXs)) → VARMAT_IN(Xs, VXs)
VARMAT_IN(.(L, Ls), .(VL, VLs)) → U31(L, Ls, VL, VLs, varmat_in(L, VL))
VARMAT_IN(.(L, Ls), .(VL, VLs)) → VARMAT_IN(L, VL)
U31(L, Ls, VL, VLs, varmat_out(L, VL)) → U41(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U31(L, Ls, VL, VLs, varmat_out(L, VL)) → VARMAT_IN(Ls, VLs)
U11(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U21(Matrix, N, unif_matrx_in(MatrixWithVars))
U11(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → UNIF_MATRX_IN(MatrixWithVars)
UNIF_MATRX_IN(.(L1, .(L2, Ls))) → U71(L1, L2, Ls, unif_lines_in(L1, L2))
UNIF_MATRX_IN(.(L1, .(L2, Ls))) → UNIF_LINES_IN(L1, L2)
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U91(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → UNIF_PAIRS_IN(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))
UNIF_PAIRS_IN(.(A, .(B, Pairs))) → U111(A, B, Pairs, unif_in(A, B))
UNIF_PAIRS_IN(.(A, .(B, Pairs))) → UNIF_IN(A, B)
U111(A, B, Pairs, unif_out(A, B)) → U121(A, B, Pairs, unif_pairs_in(Pairs))
U111(A, B, Pairs, unif_out(A, B)) → UNIF_PAIRS_IN(Pairs)
U91(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U101(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U91(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → UNIF_LINES_IN(.(X, L1s), .(Z, L2s))
U71(L1, L2, Ls, unif_lines_out(L1, L2)) → U81(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U71(L1, L2, Ls, unif_lines_out(L1, L2)) → UNIF_MATRX_IN(.(L2, Ls))
shapes_in(Matrix, N) → U1(Matrix, N, varmat_in(Matrix, MatrixWithVars))
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U1(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U2(Matrix, N, unif_matrx_in(MatrixWithVars))
unif_matrx_in(.(X, [])) → unif_matrx_out(.(X, []))
unif_matrx_in(.(L1, .(L2, Ls))) → U7(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_pairs_in([]) → unif_pairs_out([])
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U7(L1, L2, Ls, unif_lines_out(L1, L2)) → U8(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U8(L1, L2, Ls, unif_matrx_out(.(L2, Ls))) → unif_matrx_out(.(L1, .(L2, Ls)))
U2(Matrix, N, unif_matrx_out(MatrixWithVars)) → shapes_out(Matrix, N)
↳ Prolog
↳ PrologToPiTRSProof
↳ PrologToPiTRSProof
↳ PiTRS
↳ DependencyPairsProof
↳ PiDP
SHAPES_IN(Matrix, N) → U11(Matrix, N, varmat_in(Matrix, MatrixWithVars))
SHAPES_IN(Matrix, N) → VARMAT_IN(Matrix, MatrixWithVars)
VARMAT_IN(.(white, Xs), .(w(X), VXs)) → U61(Xs, X, VXs, varmat_in(Xs, VXs))
VARMAT_IN(.(white, Xs), .(w(X), VXs)) → VARMAT_IN(Xs, VXs)
VARMAT_IN(.(black, Xs), .(black, VXs)) → U51(Xs, VXs, varmat_in(Xs, VXs))
VARMAT_IN(.(black, Xs), .(black, VXs)) → VARMAT_IN(Xs, VXs)
VARMAT_IN(.(L, Ls), .(VL, VLs)) → U31(L, Ls, VL, VLs, varmat_in(L, VL))
VARMAT_IN(.(L, Ls), .(VL, VLs)) → VARMAT_IN(L, VL)
U31(L, Ls, VL, VLs, varmat_out(L, VL)) → U41(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U31(L, Ls, VL, VLs, varmat_out(L, VL)) → VARMAT_IN(Ls, VLs)
U11(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U21(Matrix, N, unif_matrx_in(MatrixWithVars))
U11(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → UNIF_MATRX_IN(MatrixWithVars)
UNIF_MATRX_IN(.(L1, .(L2, Ls))) → U71(L1, L2, Ls, unif_lines_in(L1, L2))
UNIF_MATRX_IN(.(L1, .(L2, Ls))) → UNIF_LINES_IN(L1, L2)
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U91(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
UNIF_LINES_IN(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → UNIF_PAIRS_IN(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))
UNIF_PAIRS_IN(.(A, .(B, Pairs))) → U111(A, B, Pairs, unif_in(A, B))
UNIF_PAIRS_IN(.(A, .(B, Pairs))) → UNIF_IN(A, B)
U111(A, B, Pairs, unif_out(A, B)) → U121(A, B, Pairs, unif_pairs_in(Pairs))
U111(A, B, Pairs, unif_out(A, B)) → UNIF_PAIRS_IN(Pairs)
U91(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U101(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U91(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → UNIF_LINES_IN(.(X, L1s), .(Z, L2s))
U71(L1, L2, Ls, unif_lines_out(L1, L2)) → U81(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U71(L1, L2, Ls, unif_lines_out(L1, L2)) → UNIF_MATRX_IN(.(L2, Ls))
shapes_in(Matrix, N) → U1(Matrix, N, varmat_in(Matrix, MatrixWithVars))
varmat_in(.(white, Xs), .(w(X), VXs)) → U6(Xs, X, VXs, varmat_in(Xs, VXs))
varmat_in(.(black, Xs), .(black, VXs)) → U5(Xs, VXs, varmat_in(Xs, VXs))
varmat_in(.(L, Ls), .(VL, VLs)) → U3(L, Ls, VL, VLs, varmat_in(L, VL))
varmat_in([], []) → varmat_out([], [])
U3(L, Ls, VL, VLs, varmat_out(L, VL)) → U4(L, Ls, VL, VLs, varmat_in(Ls, VLs))
U4(L, Ls, VL, VLs, varmat_out(Ls, VLs)) → varmat_out(.(L, Ls), .(VL, VLs))
U5(Xs, VXs, varmat_out(Xs, VXs)) → varmat_out(.(black, Xs), .(black, VXs))
U6(Xs, X, VXs, varmat_out(Xs, VXs)) → varmat_out(.(white, Xs), .(w(X), VXs))
U1(Matrix, N, varmat_out(Matrix, MatrixWithVars)) → U2(Matrix, N, unif_matrx_in(MatrixWithVars))
unif_matrx_in(.(X, [])) → unif_matrx_out(.(X, []))
unif_matrx_in(.(L1, .(L2, Ls))) → U7(L1, L2, Ls, unif_lines_in(L1, L2))
unif_lines_in(.(X, []), .(X1, [])) → unif_lines_out(.(X, []), .(X1, []))
unif_lines_in(.(W, .(X, L1s)), .(Y, .(Z, L2s))) → U9(W, X, L1s, Y, Z, L2s, unif_pairs_in(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, []))))))))))))))
unif_pairs_in(.(A, .(B, Pairs))) → U11(A, B, Pairs, unif_in(A, B))
unif_in(w(X), black) → unif_out(w(X), black)
unif_in(black, w(X)) → unif_out(black, w(X))
unif_in(black, black) → unif_out(black, black)
unif_in(w(A), w(A)) → unif_out(w(A), w(A))
U11(A, B, Pairs, unif_out(A, B)) → U12(A, B, Pairs, unif_pairs_in(Pairs))
unif_pairs_in([]) → unif_pairs_out([])
U12(A, B, Pairs, unif_pairs_out(Pairs)) → unif_pairs_out(.(A, .(B, Pairs)))
U9(W, X, L1s, Y, Z, L2s, unif_pairs_out(.(W, .(X, .(Y, .(Z, .(W, .(Y, .(X, .(Z, .(W, .(Z, .(X, .(Y, [])))))))))))))) → U10(W, X, L1s, Y, Z, L2s, unif_lines_in(.(X, L1s), .(Z, L2s)))
U10(W, X, L1s, Y, Z, L2s, unif_lines_out(.(X, L1s), .(Z, L2s))) → unif_lines_out(.(W, .(X, L1s)), .(Y, .(Z, L2s)))
U7(L1, L2, Ls, unif_lines_out(L1, L2)) → U8(L1, L2, Ls, unif_matrx_in(.(L2, Ls)))
U8(L1, L2, Ls, unif_matrx_out(.(L2, Ls))) → unif_matrx_out(.(L1, .(L2, Ls)))
U2(Matrix, N, unif_matrx_out(MatrixWithVars)) → shapes_out(Matrix, N)